package com.beiing.tianshuai.tianshuai.mine.presenter;

import com.beiing.tianshuai.tianshuai.mine.entity.OrderTransportDataBean;
import com.beiing.tianshuai.tianshuai.mine.model.OrderTransportModel;
import com.beiing.tianshuai.tianshuai.mine.model.OrderTransportModelImpl;
import com.beiing.tianshuai.tianshuai.mine.view.OrderTransportViewImpl;

/**
 * Created by Administrator on 2018/4/7.
 */

public class OrderTransportPresenter implements OrderTransportPresenterImpl,OrderTransportModel.OrderTransportDataResponseListener{

    private OrderTransportViewImpl mView;
    private OrderTransportModelImpl mModel;

    public OrderTransportPresenter(OrderTransportViewImpl view) {
        mView = view;
        mModel = new OrderTransportModel(this);
    }
    @Override
    public void getOrderStatus(String oid) {
        mView.showProgress();
        mModel.getOrderDetail(oid);
    }

    @Override
    public void onGetDetailSuccess(OrderTransportDataBean bean) {
        //请求成功返回
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onGetDetailError(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
